package com.lanyun.aicorrectassistant.controller.admin.gradingResults;

import com.lanyun.aicorrectassistant.controller.admin.gradingResults.vo.GradingResultsRequestPageVO;
import com.lanyun.aicorrectassistant.controller.admin.gradingResults.vo.GradingResultsRequestVO;
import com.lanyun.aicorrectassistant.controller.admin.gradingResults.vo.GradingResultsResponseVO;
import com.lanyun.aicorrectassistant.domain.gradingResults.GradingResultsDomainService;
import com.lanyun.aicorrectassistant.basic.bean.PageResult;
import com.lanyun.aicorrectassistant.basic.bean.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import jakarta.annotation.Resource;

/**
 * AI批改结果表控制器
 * @author makejava
 * @version 1.0
 * @date 2025-05-12 01:53:58
 */
@RequestMapping("/api-admin/gradingResults")
@RestController("adminGradingResultsController")
@Slf4j
public class GradingResultsController {

    @Resource
    private GradingResultsDomainService gradingResultsDomainService;

    /**
     * 分页查询AI批改结果表
     */
    @PostMapping("/page")
    public Result<PageResult<GradingResultsResponseVO>> page(@RequestBody GradingResultsRequestPageVO requestPageVO) {
        return Result.success(gradingResultsDomainService.page(requestPageVO));
    }

    /**
     * 新增AI批改结果表
     */
    @PostMapping("/create")
    public Result<Boolean> create(@RequestBody GradingResultsRequestVO requestVO) {
        return Result.success(gradingResultsDomainService.insert(requestVO));
    }

    /**
     * 修改AI批改结果表
     */
    @PostMapping("/update")
    public Result<Boolean> update(@RequestBody GradingResultsRequestVO requestVO) {
        return Result.success(gradingResultsDomainService.update(requestVO));
    }

    /**
     * 删除AI批改结果表
     */
    @DeleteMapping("/delete/{id}")
    public Result<Boolean> delete(@PathVariable("id") Long id) {
        return Result.success(gradingResultsDomainService.delete(id));
    }

    /**
     * 获取AI批改结果表详情
     */
    @GetMapping("/get/{id}")
    public Result<GradingResultsResponseVO> get(@PathVariable("id") Long id) {
        return Result.success(gradingResultsDomainService.get(id));
    }
}
